<?php
declare(strict_types=1);

namespace LowCode\Naive;

use LowCode\Naive;
use LowCode\Support\JsExp;

/**
 * 图片组件 ImageGroup
 * @method static static make(mixed $children = null) ImageGroup组件
 */
class ImageGroup extends Naive
{
    public function __construct(mixed $children = null)
    {
        parent::__construct();
        $children && $this->children($children);
    }


    /**
     * 图片放大后是否展示底部工具栏
     * @param bool $bool,
     * @return $this
     */
    public function showToolbar(bool|JsExp $bool = true): static
    {
        return $this->prop('showToolbar', $bool);
    }

    /**
     * 是否展示工具栏的提示
     * @param bool|JsExp $bool,
     * @return $this
     */
    public function showToolbarTooltip(bool|JsExp $bool = true): static
    {
        return $this->prop('showToolbarTooltip', $bool);
    }

    /**
     * 工具栏的渲染函数
     * (props: { nodes: { prev: VNode, next: VNode, rotateCounterclockwise: VNode, rotateClockwise: VNode, resizeToOriginalSize: VNode, zoomOut: VNode, zoomIn: VNode, download: VNode, close: VNode } }) => VNodeChild
     * @param string $value
     * @param string|null $id
     * @return $this
     */
    public function renderToolbar(string $value, string $id = null): static
    {
        return $this->jsFunction('render-toolbar', $value, $id);
    }

}
